import { createApp } from 'vue'
import '@/styles/index.scss'
import App from '@/App.vue'
import 'ant-design-vue/dist/reset.css'
import router from './router'
import VXETable from 'vxe-table'
import store from './store'
import 'vxe-table/lib/style.css'
import 'virtual:svg-icons-register'
import '@/router/permisstion'
import globalComponents from '@/components/index' //全局组件
import directives from '@/directives/index.ts' //自定义指令
import 'wc-waterfall'
//引入图片懒加载插件
import Lazyload from 'vue3-lazyload'
import vue3PhotoPreview from 'vue3-photo-preview'
import 'vue3-photo-preview/dist/index.css'
import loading from '@/assets/images/loading.webp'
import error from '@/assets/images/error.gif'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import fastDataviewUi from 'fast-dataview-ui'
import 'fast-dataview-ui/theme/index.css'
// 动态路由
import { initRoute } from '@/router/permisstion'
VXETable.config({
  size: 'small', // 全局尺寸
  // i18n: (key: string, args: any) => i18n.global.t(key, args),
  // translate(key, args) {
  //     return i18n.global.t(key, args)
  // }
})

const app = createApp(App)
store.use(piniaPluginPersistedstate)
app.use(store)
initRoute()

app.use(router)
app.use(VXETable)
app.use(globalComponents)
app.use(directives)
//注册插件
app.use(Lazyload, {
  loading: loading, //可以指定加载中的图像
  error: error, //可以指定加载失败的图像
})
app.use(vue3PhotoPreview)
app.use(fastDataviewUi)
app.mount('#app')
